#!/bin/sh
len=$#
lenFlag=$len%2
# 判断参数长度
if (($len >= 2 && $lenFlag != 0))
then
  exit 1
fi
# 循环处理参数
index=0
for arg in $*
do
  let index+=1
  flag=$index%2
  if (($flag == 0))
  then
    echo "进入$arg目录"
    git pull
    echo "更新完成"
  else
    cd $arg
  fi
done
